package com.fliad.ai.dto.taskmodel;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class NodeReport extends StatusData {

    private String id;
    private List<Snapshot> snapshots;

    public NodeReport(String id) {
        super();
        this.id = id;
        snapshots = new ArrayList<>();
    }

    public Snapshot addSnapshot(Snapshot snapshot) {
        snapshots.add(snapshot);
        return snapshot;
    }

    // 获取最后一个节点快照
    public Snapshot getLastSnapshot() {
        return snapshots.get(snapshots.size() - 1);
    }

}
